package vip.liux.front.adapter.web;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import vip.liux.application.dots.ListResultDto;
import vip.liux.contracts.shared.enums.product.CategoryType;
import vip.liux.front.application.service.product.CategoryDto;
import vip.liux.front.application.service.product.CategoryService;

/**
 * 验证码控制器
 */
@RestController
@RequestMapping("/api/category")
public class CategoryController {

    private final CategoryService categoryService;

    public CategoryController(CategoryService categoryService) {
        this.categoryService = categoryService;
    }

    @GetMapping("/list")
    public ListResultDto<CategoryDto> list(@RequestParam(defaultValue = "PHYSICAL") CategoryType type) {
        return categoryService.list(type);
    }
}
